<template>
  <div class="courseTeach">
    <div class="title">
      <h3 class="inTits"><span></span>课程教学</h3>
    </div>
    <div class="tabbar">
      <tab-teach-component></tab-teach-component>
    </div>
  </div>
</template>

<script>
import { listCourse } from '@/api/teach/course/course'
import TabTeachComponent from '@/views/home/components/TabTeachComponent.vue'

export default {
  name: 'CourseTeach',
  components: { TabTeachComponent },
  data() {
    return {
      primaryCourseList: [],
      mideleCourseList: [],
      highCourseList: [],
      queryParams: {
        pageNum: 1,
        pageSize: 4,
        courseLevel: 1
      }
    }
  },
  created() {
    this.getList()
  },
  methods: {
    getList() {
      this.loading = true
      listCourse(this.queryParams).then(response => {
        this.primaryCourseList = response.rows
      })
      this.queryParams.courseLevel = 2
      listCourse(this.queryParams).then(response => {
        this.mideleCourseList = response.rows
      })
      this.queryParams.courseLevel = 3
      listCourse(this.queryParams).then(response => {
        this.highCourseList = response.rows
      })
      this.loading = false
    }
  }

}
</script>

<style lang="scss" scoped>
.courseTeach {
  width: 1600px;
  margin: auto;
  //border-bottom: 1px solid #dcdcdc;
  padding: 40px 0;

  .title {
    text-align: center;
    font-size: 22px;
    color: #a77e30;

    .inTits {
      width: 100%;
      height: 60px;
      line-height: 60px;
    }

    .inTits span {
      background: url("@/assets/quick/name_ico_yellow.png") no-repeat;
      background-size: cover;
      display: inline-block;
      width: 30px;
      height: 30px;
      float: none;
      margin-right: 5px;
      vertical-align: middle; /* 可以使元素在行内垂直居中 */
    }
  }

  .list {
    overflow: hidden;

    .clearfix {
      zoom: 1;
    }

    li {
      position: relative;
      float: left;
      width: 23%;
      height: 280px;
      margin: 20px 20px 0 0;
      overflow: hidden;

      span {
        position: absolute;
        bottom: 0;
        left: 0;
        height: 40px;
        width: 100%;
        text-align: center;
        background: #a77e30;
        color: #ffffff;
        font-size: 18px;
        line-height: 40px;
        white-space: nowrap;
        z-index: 104;
      }

      img {
        width: 100%;
        height: 100%;
      }
    }
  }


}

</style>
